using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Audio;
using Microsoft.Xna.Framework.Media;

namespace gears
{
   public class SoundEffects
    {
       public Dictionary<string, SoundEffect> mySoundEffects;

        public SoundEffects()
        {
            mySoundEffects = new Dictionary<string, SoundEffect>();
        }

        

        public Dictionary<string, SoundEffect> MySoundEffects
        {
            get { return mySoundEffects; }
        }

        public void Add(string effectName, SoundEffect effect)
        {
            mySoundEffects.Add(effectName, effect);
        }

        public void Delete(string effectName)
        {
            mySoundEffects.Remove(effectName);
        }

        public void Play(string effectName)
        {
            SoundEffect.MasterVolume = MediaPlayer.Volume;

            SoundEffect myEffect;

            if (mySoundEffects.ContainsKey(effectName))
            {
                myEffect = mySoundEffects[effectName];

                myEffect.Play();
            }
        }
    }
}
